package com.chinawayltd.ews.sample.job;

import com.chinawayltd.ews.sample.service.SynchroVehicleService;
import com.chinawayltd.ews.sample.taskCenter.TaskJob;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 车辆数据同步任务
 * @program: greeProject.timingTaskCenter
 * @description:
 * @author: xiazj
 * @create: 2018-04-24 11:24
 **/
@Component
public class SynchroVehicleJob implements TaskJob {

    private static Logger logger = LoggerFactory.getLogger(SynchroVehicleJob.class);
    @Autowired
    private SynchroVehicleService synchroVehicleService;

    @Override
    public void doJob(JobExecutionContext context) {
        try {
            synchroVehicleService.synchroVehicleData();
        } catch (Exception e) {
            logger.error("车辆同步定时器执行时发生错误！", e);
        }
    }

}
